import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass } from "vue";
import { Panel, PanelTitle, PanelContent } from "../panel/index.mjs";
import { Empty } from "../empty/index.mjs";
const _hoisted_1 = { class: "me-resource-panel-filter-header" };
const _hoisted_2 = { class: "me-resource-panel-filter-header-text" };
const _hoisted_3 = { class: "me-resource-panel-filter-header-total" };
const _hoisted_4 = {
  key: 0,
  class: "me-resource-panel-filter-content"
};
const _hoisted_5 = ["onClick"];
const _hoisted_6 = {
  key: 1,
  class: "me-resource-panel-filter-content"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "resource-filter-panel",
  props: {
    layer: { default() {
      return {};
    } },
    filterList: { default() {
      return [[]];
    } }
  },
  emits: ["click"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const clickFilter = (filter, layer) => {
      filter.selected = !filter.selected;
      emits("click", filter, layer);
    };
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Panel), { class: "me-resource-panel-filter" }, {
        default: withCtx(() => [
          createVNode(unref(PanelTitle), null, {
            default: withCtx(() => [
              createElementVNode("div", _hoisted_1, [
                createElementVNode("span", _hoisted_2, toDisplayString(_ctx.layer.title), 1),
                createElementVNode("span", _hoisted_3, toDisplayString(_ctx.layer.total), 1)
              ])
            ]),
            _: 1
          }),
          createVNode(unref(PanelContent), { class: "me-resource-panel-filter-box" }, {
            default: withCtx(() => [
              _ctx.filterList.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filterList, (list, index) => {
                  return openBlock(), createElementBlock("div", {
                    class: "me-resource-panel-filter-content-list",
                    key: index
                  }, [
                    (openBlock(true), createElementBlock(Fragment, null, renderList(list, (item, index2) => {
                      return openBlock(), createElementBlock("span", {
                        onClick: ($event) => clickFilter(item, _ctx.layer),
                        class: normalizeClass(["me-resource-panel-filter-content-list-item", { selected: item.selected }]),
                        key: index2
                      }, toDisplayString(item.name), 11, _hoisted_5);
                    }), 128))
                  ]);
                }), 128))
              ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
                createVNode(unref(Empty), { description: "暂无数据" })
              ]))
            ]),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
//# sourceMappingURL=resource-filter-panel.vue2.mjs.map
